<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./deepstream.js"></script>
</head>
<body>
    <button id="btn1">Emitter</button>
    <button id="btn2">Stop</button>
    <input id="input1"></input>
</body>

<script>
const server = '127.0.0.1:6020';
const user = {
    username: 'rpc',
    password: '123456',
}

var timer1 = null;

const client = deepstream(server).login(
user,
function(success, data) {
    if(success) {
        console.log('Login successful!');
    }
    else {
        console.log('Login failed!');
        console.log(data);
    }
} );

const input1 = document.getElementById('input1');

const btn1 = document.getElementById('btn1');
btn1.onclick = function() {
    var data = {
        catcherID: 2223,
        userID: "9527",
    }
    client.rpc.make("rpc/claw.single/participate", data, (res, err) => {
        console.log('done!');
    } )
};

const btn2 = document.getElementById('btn2');
btn2.onclick = function() {
}



</script>
</html>